package com.es.service.impl;

import java.util.List;

import org.aspectj.internal.lang.annotation.ajcDeclareAnnotation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import com.es.dao.ArticleRepository;
import com.es.service.ArticleService;
import com.esentity.Article;
@Service
public class ArticleServiceImpl implements ArticleService{

	@Autowired
	private ArticleRepository articleRepository;
	@Override
	public void save(Article article) {
		// TODO Auto-generated method stub
		articleRepository.save(article);
	}

	@Override
	public void delete(Article article) {
		// TODO Auto-generated method stub
		articleRepository.delete(article);
	}

	@Override
	public Article findOne(Integer id) {
		// TODO Auto-generated method stub
		return articleRepository.findOne(id);
	}

	@Override
	public Iterable<Article> findAll() {
		// TODO Auto-generated method stub
		return articleRepository.findAll();
	}

	@Override
	public Page<Article> findAll(Pageable pageable) {
		// TODO Auto-generated method stub
		return articleRepository.findAll(pageable);
	}

	@Override
	public List<Article> findByTitle(String title) {
		// TODO Auto-generated method stub
		return articleRepository.findByTitle(title);
	}

	@Override
	public Page<Article> findByTitle(String title, Pageable pageable) {
		// TODO Auto-generated method stub
		return articleRepository.findByTitle(title, pageable);
	}
	
}
